﻿<UserControl
	xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
	xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
	xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
	xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
    xmlns:Controls="clr-namespace:Microsoft.Surface.Presentation.Controls;assembly=Microsoft.Surface.Presentation"
    xmlns:CustomControl1="clr-namespace:ScrumTable.UI.View.CustomControl;assembly=ScrumTable.UI.View" xmlns:Localization="clr-namespace:ScrumTable.UI.View.Localization;assembly=ScrumTable.UI.View" xmlns:Util="clr-namespace:ScrumTable.UI.View.WinTouch.Util" x:Class="ScrumTable.UI.View.WinTouch.Util.DynamicErrorControl"	x:Name="UserControl">    
    <Grid>
        <!--Converter is added code behind-->
        <Border BorderBrush="Red" CornerRadius="5" BorderThickness="{Binding SynchronizationErrors, Converter={StaticResource Converter2}}">                  
            <StackPanel Orientation="Vertical">               
                <StackPanel.Children>
                    <UserControl Content="{Binding BaseControl, ElementName=UserControl}"></UserControl>
                    <!--Converter is added code behind-->
                    <Label Foreground="Red" x:Name="ErrorLabel" FontSize="12" Content="{Binding SynchronizationErrors, Converter={StaticResource Converter}}">
                        <Label.Style>                            
                            <Style TargetType="{x:Type Label}">                                
                                <Style.Setters>                
                                    <Setter Property="Label.Visibility" Value="Visible"/>                                    
                                </Style.Setters>
                                <Style.Triggers>                                    
                                    <Trigger Property="Label.Content"  Value="{x:Null}">
                                        <Setter Property="Label.Visibility"    Value="Collapsed" />                                      
                                    </Trigger>                                    
                                </Style.Triggers>
                            </Style>
                        </Label.Style>
                    </Label>
                </StackPanel.Children>
            </StackPanel>
        </Border>
    </Grid>
</UserControl>    